<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>05_DOM操作2</title>
</head>
<body>
<input type="text" id="i1">
<br>
<input type="text" id="i2">
<button onclick="f1()">按钮1</button>
<hr>
<h3>震惊 <span class="s"></span></h3>
<button onclick="f2()">按钮2</button>
<script>
    function f1() {
        let input1=document.querySelector("#i1");
        let input2=document.getElementById("i2");

        console.log(input1.value+input2.value);
        let i1=parseFloat(input1.value);
        let i2=parseFloat( input2.value);
        console.log(i1+i2);
    }
    function f2(){
        let spanE=document.querySelector('.s');
        spanE.innerHTML='段照宏国庆假期竟做出这种事，引隔壁村80岁老太不忍直视';
        spanE.style.color='red';

    }
</script>
</body>
</html>